<script>
// import { getInstitution } from '@/api/subject'
import { loadScriptAsync } from "@/utils/utils";
import { mapGetters, mapActions } from "vuex";
export default {
  globalData: {},
  data() {
    return {
      barTitle: ""
    };
  },
  onLaunch: function() {
    console.log("app启动执行");
    //this.getConfig();
  },
  onShow: function() {
      console.log("App Show");
  },
  onHide: function() {
    console.log("App Hide");
  },
  computed: {
    ...mapGetters(["headerName"])
  },
  methods: {
    ...mapActions("user", ["setHeaderName"]),

    // 获取机构配置文件
    /*getConfig() {
      // 获取动态域名
      var src;
      const time = new Date().getTime();
      if (process.env.NODE_ENV === "development") {
        //开发环境
        src = `organizationConfig/localhost.config.js?time=${time}`;
      } else {
        const share_id = window.location.href.split("S-")[1].split("/")[0];
        const configName = `${share_id}.config.js`;
        const host = window.location.hostname.split(".");
        if (host[0] === "jst") {
          //预发布环境
          src = `http://${share_id}.jst.organ.zxxpt.cn/organizationConfig/${configName}?time=${time}`;
        } else {
          //正式环境
          src = `http://${share_id}.organ.zxxpt.cn/organizationConfig/${configName}?time=${time}`;
        }
      }
      console.log(src);
      // 动态加载配置文件
      loadScriptAsync(src)
        .then(res => {
          console.log("文件加载完成");
          if (window.organizationConfig.headerName) {
            this.setHeaderName(window.organizationConfig.headerName);
          } else {
            this.setHeaderName("");
          }
        })
        .catch(err => {
          console.log("err", err);
        });
    }*/
  }
};
</script>

<style lang="scss">
@import "uview-ui/index.scss";
@import "./style/iconfont.css";
@import "./style/iconfont-skin.css";
@import "./style/iconfav.css";
@import "./style/iconexam.css";
@import "./style/icons.css";
/*每个页面公共css暂时存放出，可写单独css至Style目录下 */
view,
scroll-view,
uni-swiper-item,
text,
navigator {
  box-sizing: border-box;
}
.main_box {
  height: 100%;
}
/* 通用按钮样式 */
.blue_btn {
  text-align: center;
  color: #fff;
  height: 88rpx;
  line-height: 88rpx;
  font-size: 28rpx;
  background: linear-gradient(90deg, #0096ff, #2447ff);
  border-radius: 44px;
}
/*通用阴影 */
.box_shadow {
  box-shadow: 0px 4rpx 27rpx 0px #efefef;
  border-radius: 10rpx;
}
/*通用圆角容器 */
.radius_content {
  width: 100%;
  background-color: #fff;
  padding: 30rpx;
  margin-top: -60rpx;
  border-radius: 30rpx;
}
//#ifdef H5
@media screen and (max-width: 1600px) {
    .page-content{
        height: 100vh;
        width: 750px;
        margin:0 auto;
    }
    .tabBar,.exercises__tabbar{
        width: 750px;
        margin:0 auto;
    }
}
@media screen and (max-width: 1400px) {
    .page-content{
        height: 100vh;
        width: 750px;
        margin:0 auto;
    }
    .tabBar,.exercises__tabbar{
        width: 750px;
        margin:0 auto;
    }
}
@media screen and (max-width: 1200px) {
    .page-content{
        height: 100vh;
        width: 750px;
        margin:0 auto;
    }
    .tabBar,.exercises__tabbar{
        width: 750px;
        margin:0 auto;
    }
}
@media screen and (max-width: 375px) {
    .page-content{
        height: 100vh;
        width: 750rpx;
        margin:0 auto;
    }
    .tabBar,.exercises__tabbar{
        width: 750rpx;
        margin:0 auto;
    }
}
@media (max-width: 1250px) {
    .page-content{
        height: 100vh;
        width: 750px;
        margin:0 auto;
    }
    .tabBar,.exercises__tabbar{
        width: 750px;
        margin:0 auto;
    }
}
@media (max-width: 1199px) {
    .page-content{
        height: 100vh;
        width: 100vw;
        margin:0 auto;
    }
    .tabBar,.exercises__tabbar{
        width: 100%;
        margin:0 auto;
    }
}
@media (max-width: 500px) {
    .page-content{
        height: 100vh;
        width: 750rpx;
        margin:0 auto;
    }
    .tabBar,.exercises__tabbar{
        width: 750rpx;
        margin:0 auto;
    }
}
@media (max-width: 375px) {
    .page-content{
        height: 100vh;
        width: 750rpx;
        margin:0 auto;
    }
    .tabBar,.exercises__tabbar{
        width: 750rpx;
        margin:0 auto;
    }
}
//#endif

</style>
